home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbnws204.zip / WINDOWS.ZIP / WINDOWS.REF < prev   
Text File  |  1991-10-16  |  5KB  |  140 lines

  1.  
  2. =======================================================================
  3.                        Routine Reference Section
  4. =======================================================================
  5.  
  6.    Popup Window manager for QuickBASIC V4.x, Microsoft BASIC 6.x, and
  7.    the Microsoft BASIC Professional Development System 7.x.
  8.  
  9.    Written by Christy Gemmell
  10.               Singular Software
  11.               22 Peake Road, Northfields
  12.               Leicester LE4 7DN, England
  13.  
  14.    For QBNews and released into the Public Domain.
  15. =======================================================================
  16.  
  17. EXPLODE
  18.  
  19. Clear a screen rectangle explosively.
  20.  
  21. DECLARE SUB Explode (BYVAL Y1%, BYVAL X1%, BYVAL Y2%, BYVAL X2%,_
  22.                      BYVAL Attr%, BYVAL Speed%)
  23.  
  24. Arguments:  Y1%         =  Upper-left row of rectangle to be cleared
  25.             X1%         =  Upper-left column of rectangle
  26.             Y2%         =  Lower-right row of rectangle
  27.             X2%         =  Lower-right column of rectangle
  28.             Attr%       =  Display attribute or colour that rectangle
  29.                            should be cleared to 
  30.             Speed%      =  Speed (in milliseconds) of explosion.
  31.  
  32. The panel is cleared, starting at the centre point, and progressively
  33. moving outwards until the defined borders are reached. This gives the
  34. impression of the clear area exploding onto the screen.
  35.  
  36. This routine is called, internally, by the POPUP window function (see
  37. below) whenever Zoom is specified.
  38.  
  39.  
  40. POPUP
  41.  
  42. This is the Toolbox popup window generator.
  43.  
  44. DECLARE SUB PopUp (BYVAL Row%, BYVAL Col%, BYVAL Hght%, BYVAL Wdth%,_
  45.                    BYVAL Attr%, BYVAL Brdr%, BYVAL Shdw%, BYVAL Zoom%)
  46.  
  47. Opens a popup window at the screen location specified.
  48.  
  49. Where:    Row%   is the top-left row co-ordinate
  50.           Col%   is the top-left column co-ordinate
  51.           Hght%  is the height (in rows) of the window
  52.           Wdth%  is the width (in columns) of the window
  53.           Attr%  is the display attribute or colour
  54.           Brdr%  is the border style (0 = no border)
  55.           Shdw%  is the shadow switch (0 = no shadow)
  56.           Zoom%  is the zoom switch (0 = no zoom)
  57.  
  58. The first four parameters specify the size of the window and the location
  59. on the screen at which it will appear. Border styles are as follows:
  60.  
  61. ┌────┐
  62. │ 1. │    Single-lined box all round the window
  63. └────┘
  64. ╔════╗
  65. ║ 2. ║    Double-lined box all round the window
  66. ╚════╝
  67. ╒════╕
  68. │ 3. │    Single vertical, double horizontal
  69. ╘════╛
  70. ╓────╖
  71. ║ 4. ║    Single horizontal, double vertical
  72. ╙────╜
  73. ╤════╤
  74. │ 5. │    Single-lined box all round the window
  75. ╘════╛
  76. ╦════╦
  77. ║ 6. ║    Double-lined box all round the window
  78. ╚════╝
  79. ┬────┬
  80. │ 7. │    Single vertical, double horizontal
  81. ╘════╛
  82. ╥────╥
  83. ║ 8. ║    Single horizontal, double vertical
  84. ╙────╜
  85.  
  86. Border styles 5 through 8 are particularly suitable for use with pull-
  87. down menus, descending from a horizontal bar.
  88.  
  89. The SHADOW switch (Parameter 7), can be used to add a black shadow beneath
  90. your window, giving it a three dimensional effect. Setting Shdw% to 1 puts
  91. solid shadow on the left-hand side. Setting Shdw% to 2 puts it on the right.
  92. values of 3 and 4 in Shdw% will display transparant shadow to the left or
  93. right, respectively, any other value prevents shadow.
  94.  
  95. Setting Parameter 8 to a non-zero value will cause the window to ZOOM onto
  96. the screen.  What this means is that, starting at a point source,
  97. successively larger versions of the window will be drawn until it is the
  98. size required. The value you supply sets the interval, in milliseconds,
  99. between iterations and is used to control the speed at which the window
  100. explodes onto the screen. 
  101.  
  102. To preserve compatibility with programs written for use with previous
  103. versions of the Toolbox, a value of -1 in parameter 8 sets the default
  104. delay of 20 milliseconds per iteration. At this speed, which is constant
  105. on PCs with all types of microprocessor, the process is extremely fast
  106. and impressive, and adds a very professional touch to your programs. 
  107.  
  108. Before a window is opened, the display area below it is copied to an
  109. internal buffer, from where it will be eventually restored when the window
  110. is closed. This buffer has a capacity of 8 KiloBytes, the equivalent of
  111. two full screens. To calculate the storage required for a particular
  112. window, use the formula:
  113.  
  114. Bytes = ((Height in rows * Width in columns) * 2) + 6
  115.  
  116. (add one row to the height and one column to the width if you specify
  117. shadow)
  118.  
  119. The window area needs to be multiplied by 2 since each screen character
  120. takes two bytes of memory, for itself and its attribute code. The odd six
  121. bytes are required for the storage of buffer pointers. The window buffer
  122. works as a LIFO (Last In First Out) stack, so that the last window opened
  123. is the first one to be removed. 
  124.  
  125.  
  126. SHUTUP
  127.  
  128. Closes the last window opened by the POPUP window procedure (see above)
  129. and restores the contents of the screen below it.
  130.  
  131. DECLARE SUB ShutUp (BYVAL Speed%)
  132.  
  133. The Speed% parameter is a delay in milliseconds. If greater than zero
  134. it produces the effect of imploding the storage buffer contents onto the
  135. screen, making the window appear to vanish into a point source.
  136.  
  137. Note:  setting Speed% to -1 produces a default delay of 20 milliseconds
  138.        per iteration.
  139.  
  140.